package com.threeox.httplibrary.builder;

import com.threeox.httplibrary.request.PostFileRequest;
import com.threeox.httplibrary.request.RequestCall;

import java.io.File;

import okhttp3.MediaType;

/**
 *
 * @ClassName: PostFileBuilder
 *
 * @Description: Todo(PostFile请求方式构造器)
 *
 * @author 赵屈犇
 *
 * @date 创建时间:2016/12/21 11:25
 *
 * @version 1.0
 */
public class PostFileBuilder extends OkHttpRequestBuilder<PostFileBuilder> {

    private File file;
    private MediaType mediaType;

    public OkHttpRequestBuilder file(File file) {
        this.file = file;
        return this;
    }

    public OkHttpRequestBuilder mediaType(MediaType mediaType) {
        this.mediaType = mediaType;
        return this;
    }

    @Override
    public RequestCall build() {
        return new PostFileRequest(url, tag, params, headers, file, mediaType, id).build();
    }


}
